using System;

using OpenTK;

namespace ColladaDotNet.OpenTKMapping
{
	public class SourceParam:DocumentLibraryElement<param>
	{
		private Source source;

		internal override void Load(param colladaData)
		{
			base.Load(colladaData);
		}

		public Type ParamType
		{
			get
			{
				switch (Collada.type)
				{
					case "float4x4":
						return typeof(Matrix4d);
					case "Name":
						return typeof(string);
					case "float":
						return typeof(double);
				}
				throw new ApplicationException("unknown type "+Collada.type);
			}
		}

		public Source Source
		{
			get
			{
				return source;
			}
			internal set
			{
				source = value;
			}
		}

		public ulong Count
		{
			get
			{
				return Source.Count;
			}
		}

		public double GetDouble(ulong i)
		{
			return Source.GetDouble(i);
		}

		public Matrix4d GetMatrix(ulong i)
		{
			return Source.GetMatrix4d(i);
		}

		public string GetName(ulong i)
		{
			return Source.GetString(i);
		}
	}
}